<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2015/12/19
 * Time: 17:41
 */
class activity_vote_topic_option_model extends CI_Model
{
    private $_table = 'activity_vote_topic_option';

    /**
     * 批量增加1
     * @param $ids
     * @return mixed
     */
    public function updateCount($ids)
    {
        $this->db->set('count', 'count + 1', false);
        $this->db->where_in('id', $ids);
        return $this->db->update($this->_table);
    }

    /**
     * 查看id是否存在
     * @param $ids
     * @return mixed
     */
    public function findByIds($ids)
    {
        $this->db->select('id, option_name');
        $this->db->from($this->_table);
        $this->db->where_in('id', $ids);
        return $this->db->get();
    }
}